$(function () {

    if($('#searchipt').val()){
        $('#searchbut').val('取消');
    }
    doPosts(1)
});

function canelSearch() {
    $('#searchipt').val('')
}

function doSearch() {
   location.href = 'A-QuestionList.html?ino=1&type=&pname='+encodeURI('搜索结果')+'&keyStr='+$('#searchipt').val();
}

function doPosts(page) {
    var ds = Commonjs.asyncAjax('../fs/busi/findDocLabelList.htm', { 'docLabel': 2});
    var listDiv = $('.main-spot-list>ul');
    if (ds && ds.length > 0) {
        $.each(ds, function (i, item) {
            var index = i+1;
            var html = '<li onclick="topages('+index+',\''+item.doc_label_id+'\',\''+item.name+'\')">';
            var index = i+1;
            html += '<a href="javascript:void(0)">'+index+'.&nbsp;' + item.name + '</a>';
            html += '</li>';
            listDiv.append(html);
        });
    }
}

function topages(index,docId,docName){
    location.href='A-QuestionList.html?ino='+index+'&type='+docId+'&pname='+encodeURI(docName);
}
